package gxdlxy.zx2202;

public class Person { // 主类
    String name = "person";
    void eat(){
        System.out.println("Person正在吃饭");
    }

    public static void main(String[] args) {
        UniversityStudent 大学生 = new UniversityStudent("大学生");
        大学生.study();
        SchoolChild 小学生 = new SchoolChild("小学生");
        小学生.study();
    }
}

class Student extends Person {
    void eat() {
        System.out.println("Student正在吃饭");
    }
    void study() {
        System.out.println(name + "正在学习");
    }
}

class Teacher extends Person {}

class SchoolChild extends Student{ // 小学生类
    SchoolChild(String _name) {
        name = _name;
    }
}

class UniversityStudent extends Student{ // 大学生类
    UniversityStudent(String _name) {
        name = _name;
    }
}
